package uk.co.douglashoskins.weathercompare;

import com.nokia.mid.ui.gestures.GestureEvent;
import com.nokia.mid.ui.gestures.GestureInteractiveZone;

public class GestureAssist {
	public static boolean isTapOrPress(GestureEvent gesture) {
		int type = gesture.getType();
		return 	type == GestureInteractiveZone.GESTURE_TAP ||
				type == GestureInteractiveZone.GESTURE_LONG_PRESS;
	}
	public static boolean tapWithinBounds(int[] bounds, GestureEvent gesture) {
		int x = gesture.getStartX();
		int y = gesture.getStartY();
		return (x > bounds[0] && x <= bounds[0] + bounds[2] && y > bounds[1] && y <= bounds[1] + bounds[3]);
	}
}
